const sourceColumn = {
  seq: { type: 'seq', width: 60 },
  name: {
    title: '姓名',
    align: 'center',
    field: 'name',
    width: 120,
    showOverflow: true
  },
  sex: {
    title: '性别',
    align: 'center',
    width: 50,
    field: 'sex',
    showOverflow: true
  },
  company: { field: 'company', title: '单位名称', showOverflow: true, width: 120 },
  department: {
    field: 'department',
    title: '部门名称',
    showHeaderOverflow: true,
    width: 100
  },
  identifyNo: {
    title: '身份证号',
    width: 160,
    field: 'identifyNo',
    showOverflow: true
  },
  birthday: {
    title: '出生年月',
    width: 120,
    field: 'birthday',
    showOverflow: true
  },
  national: {
    title: '民族',
    width: 120,
    field: 'national',
    showOverflow: true
  },
  origin: {
    title: '籍贯',
    field: 'origin',
    width: 120,
    showOverflow: true
  },
  birthplace: {
    title: '出生地',
    width: 120,
    field: 'birthplace',
    showOverflow: true
  },
  age: {
    title: '年龄',
    width: 50,
    field: 'age',
    showOverflow: true
  },
  workDay: {
    title: '工作日期',
    field: 'workDay',
    width: 120,
    showOverflow: true
  },
  workAge: {
    title: '工龄',
    width: 50,
    field: 'workAge',
    showOverflow: true
  },
  position: {
    title: '职务/岗位',
    width: 120,
    field: 'position',
    showOverflow: true
  },
  identity: {
    title: '个人身份',
    width: 120,
    field: 'identity',
    showOverflow: true
  },
  // recordType_dictText: {
  //   title: '编制性质',
  //   width: 120,
  //   field: 'recordType_dictText',
  //   showOverflow: true
  // },
  // treatment_dictText: {
  //   title: '待遇级别',
  //   width: 120,
  //   field: 'treatment_dictText',
  //   showOverflow: true
  // },
  // talentType_dictText: {
  //   title: '人才类型',
  //   width: 120,
  //   field: 'talentType_dictText',
  //   showOverflow: true
  // },
  leader: {
    title: '部管干部',
    width: 80,
    field: 'leader',
    showOverflow: true
  },
  remark: {
    title: '备注',
    field: 'remark',
    width: 120,
    showOverflow: true
  }
  // operate: {
  //   title: '操作',
  //   // fixed: 'right',
  //   showOverflow: true,
  //   width: 200,
  //   slots: { default: 'operate' }
  // }
}
export function getSourceColumn (customColumn) {
  const column = []
  if (customColumn && customColumn.length > 0) {
    for (let index = 0; index < customColumn.length; index++) {
      if (customColumn[index] && sourceColumn[customColumn[index]]) {
        column.push(sourceColumn[customColumn[index]])
      }
    }
  } else {
    for (const sourceColumnKey in sourceColumn) {
      column.push(sourceColumn[sourceColumnKey])
    }
  }
  return column
}
export function getSourceColumnCode (customColumn) {
  const column = []
  if (customColumn && customColumn.length > 0) {
    for (let index = 0; index < customColumn.length; index++) {
      if (customColumn[index] && sourceColumn[customColumn[index]]) {
        column.push(sourceColumn[customColumn[index]].property)
      }
    }
  } else {
    for (const sourceColumnKey in sourceColumn) {
      column.push(sourceColumnKey)
    }
  }
  return column
}
export function getColumn (that) {
  return [
    {
      type: 'checkbox',
      width: 40
    },
    { type: 'seq', width: 60 },
    { field: 'companyName', title: '单位名称', showOverflow: true, width: 120 },
    {
      field: 'sysOrgCode',
      title: '部门名称',
      showHeaderOverflow: true,
      width: 100
    },
    { field: 'name', title: '姓名', showOverflow: true, width: 120 },
    { field: 'sex_dictText', title: '性别', showOverflow: true, width: 120 },
    { field: 'national_dictText', title: '民族', showOverflow: true, width: 100 },
    {
      field: 'identityNo',
      title: '身份证号',
      showOverflow: true,
      width: 180
    },
    {
      field: 'position',
      title: '职务/岗位',
      showOverflow: true,
      width: 120
    },
    {
      field: 'birthday',
      title: '出生日期',
      showOverflow: true,
      width: 120
    },
    { field: 'age', title: '年龄', showOverflow: true, width: 120 },
    {
      field: 'workDay',
      title: '参加工作时间',
      showOverflow: true,
      width: 120
    },
    { field: 'workAge', title: '工龄', showOverflow: true, width: 120 },
    { field: 'origin', title: '籍贯', showOverflow: true, width: 120 },
    {
      field: 'talentType_dictText',
      title: '人才类别',
      showOverflow: true,
      width: 120
    },
    {
      field: 'leader_dictText',
      title: '是否部管干部',
      showOverflow: true,
      width: 120
    },
    {
      field: 'staffIdentity_dictText',
      title: '个人身份',
      showOverflow: true,
      width: 120
    },
    {
      field: 'recordType_dictText',
      title: '编制性质',
      showOverflow: true,
      width: 120
    },
    {
      field: 'treatment_dictText',
      title: '享受待遇级别',
      showOverflow: true,
      width: 120
    },
    {
      field: 'remark',
      title: '备注内容',
      showOverflow: true,
      width: 120
    },
    // {
    //   title: '操作',
    //   fixed: 'right',
    //   showOverflow: true,
    //   width: 160,
    //   slots: { default: 'operate' }
    // }
  ]
}
